<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    
    template="/WEB-INF/layouts/standard.xhtml"
>
<ui:define name="notes">
    <p>Hier k&ouml;nnen die Nutzer Administriert werden.</p>
</ui:define>
<ui:define name="content">
<p:panel id="userAdministration">
    <h:form >
        <p:messages/>
        <p:fieldset legend="Existierende Nutzer">
            <h:selectOneListbox value="#{userAdminForm.selectedPlayer.name}" size="5">
                <f:selectItems value="#{userAdminForm.players}" var="player" itemLabel="#{player.name}" itemValue="#{player.name}" />
            </h:selectOneListbox>
            <p:commandButton value="L&ouml;schen" id="deleteUserButton" action="deleteUser" ajax="false" />
        </p:fieldset>
        <p:fieldset legend="Daten des neuen Nutzers">
            <div>
                <div><h:outputLabel for="createUserName">Spielername:</h:outputLabel></div>
                <div>
                    <p><h:inputText id="createUserName" value="#{userAdminForm.newPlayer.name}" title="Spielername" /></p>
                </div>
            </div>
            <div>
                <div>Password:</div>
                <div>
                    <p><h:inputSecret id="createUserPassword" value="#{userAdminForm.newPlayerPassword}" title="Spielerpassword" /></p>
                </div>
            </div>
            <p:commandButton id="createUserButton" value="Erstellen" action="createUser" ajax="false"/>
        </p:fieldset>
    </h:form>
<!--     <h:form > -->
<!--         <p:panel id="existingUsers" header="Vorhandene Nutzer"> -->
<!--         </p:panel> -->

<!--         <p:panel id="newUser" header="Neuer Nutzer"> -->
<!--
                <div>
                    <p:commandButton id="createUserButton" value="Erstellen" action="createUser"/>
                </div>
-->
<!--         </p:panel> -->
<!--     </h:form> -->
</p:panel>
<!--             <input type="submit" name="_eventId_createUser" value="Erstellen" /> -->
<!--             <h:commandButton value="Erstellen" id="createUserButton" action="createUser" /> -->
<!--             <h:commandLink value="Erstellen" id="createUserLink" action="createUser" /> -->
<!-- 
        <h:dataTable id="players"
             captionStyle="font-weight:bold"
             columnClasses="list-column-center, list-column-left, list-column-right, list-column-center"
             footerClass="list-footer"
             headerClass="list-header"
             rowClasses="list-row-even, list-row-odd"
             styleClass="list-background"
             summary="The Summary"
             value="#{userAdminForm.players}"
             
             border="1"
             var="item"
         >
            <f:facet name="header">  
                <h:outputText value="Alle Nutzer" />  
            </f:facet>  
            <h:column>  
                <f:facet name="header"><h:outputText value="Name" /></f:facet>  
                <h:outputText value="#{item.name}" />  
            </h:column>  
            <h:column>  
                <f:facet name="header"><h:outputText value="Authorities" /></f:facet>  
                <h:outputText value="#{item.authorities}" />  
            </h:column>  
            <f:facet name="footer">
                <h:outputText value="Das ist der Footer" />  
            </f:facet>  
        </h:dataTable>
-->
</ui:define>
</ui:composition>